package com.example.gaojt.androiddemo.webViewStudy;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.webkit.WebView;

import java.util.Map;

/**
 * Created by gaojt on 8/7/17.
 */

public class MyWebView extends WebView {
    private static final String TAG = "MyWebView";
    public MyWebView(Context context) {
        this(context,null);
    }

    public MyWebView(Context context, AttributeSet attrs) {
        this(context, attrs,0);
    }

    public MyWebView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public void loadData(String data, String mimeType, String encoding) {
        Log.d(TAG, "loadData: ");
        super.loadData(data, mimeType, encoding);
    }

    @Override
    public void loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl) {
        Log.d(TAG, "loadDataWithBaseURL: baseUrl = " + baseUrl);
        super.loadDataWithBaseURL(baseUrl, data, mimeType, encoding, historyUrl);
    }

    @Override
    public void loadUrl(String url) {
        Log.d(TAG, "loadUrl: url = " + url);
        super.loadUrl(url);
    }

    @Override
    public void loadUrl(String url, Map<String, String> additionalHttpHeaders) {
        Log.d(TAG, "loadUrl: url = " + url);
        super.loadUrl(url, additionalHttpHeaders);
    }

}
